package book;

public class BookList {
    private Book books[];
    private int usedSize;//记录书架书的数量

    public BookList() {
        this.books = new Book[10];
        this.books[0] = new Book("三国演义","罗贯中","小说",13);
        this.books[1] = new Book("西游记","吴承恩","小说",13);
        this.books[2] = new Book("红楼梦","曹雪芹","小说",56);
        this.usedSize = 3;
    }

    public int getUsedSize() {//需要调用下标 写一个获取和输入个数方法
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public Book getBook(int pos) {//private不能直接调用 所以返回位置
        return books[pos];
    }

    public void setBook(Book book ,int pos) {
        books[pos] = book;
    }
}
